#ifndef SIP_DEBUGINFO_HPP__
#define SIP_DEBUGINFO_HPP__

#include <string>
#include <sstream>

#ifdef _DEBUG

#define __FILENAME__(FNAME)                {      \
    std::string tmpFull = __FILE__;          \
    int i = tmpFull.find_last_of("\\");       \
    if (i > 0){                                  \
    FNAME = tmpFull.substr(i+1);           \
    }                                              \
     }


#define STDOUT_LINE(TYPE, MSGEXP)         {\
    std::string fileName;        \
    __FILENAME__(fileName);    \
    std::ostringstream osm;         \
    osm << #TYPE << ": " << MSGEXP;          \
    osm << " @File:" << fileName << " @Line:" << __LINE__ << std::endl;    \
    std::cout << osm.str();          \
     }


#define ERROR_LINE(MSGEXP)  STDOUT_LINE(ERROR, MSGEXP)

#define INFO_LINE(MSGEXP)   STDOUT_LINE(INFO, MSGEXP)

#else

#define ERROR_LINE(MSGEXP)

#define INFO_LINE(MSGEXP)

#endif



#endif

